package com.zbl.zblproject.pay.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * @author youlanqiang
 * @version 1.0
 * @date 2019/1/9
 */
@Repository
public interface AlipayTokenMapper {

    @Select("SELECT auth_token FROM zbl_alipay_token LIMIT 1")
    String getAuthToken();

    @Update("UPDATE zbl_alipay_token SET auth_token = #{token}")
    boolean updateAuthToken(@Param("token") String token);

    @Select("SELECT count(*) FROM zbl_alipay_token")
    int size();

    @Insert("INSERT INTO zbl_alipay_token(auth_token) VALUES(#{token})")
    boolean insertAuthToken(@Param("token") String token);

}
